// ==========================================================================
// 生成人：JasonLaw
// ==========================================================================
package CrmGiftGoodsModel

import (
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/os/gtime"
)

// Entity is the golang structure for table crmGiftGoods.
type Entity struct {
	Id          uint        `orm:"id,primary" json:"id"`           // ID
	CreateTime  *gtime.Time `orm:"createTime" json:"createTime"`   // 创建时间
	UpdateTime  *gtime.Time `orm:"updateTime" json:"updateTime"`   // 更新时间
	Title       string      `orm:"title" json:"title"`             // 商品标题
	Description string      `orm:"description" json:"description"` // 描述
	Pic         string      `orm:"pic" json:"pic"`                 // 图片
	OriginPrice float64     `orm:"originPrice" json:"originPrice"` // 原价格
	Price       float64     `orm:"price" json:"price"`             // 当前价格
	Discount    float64     `orm:"discount" json:"discount"`       // 优惠的价格
	Inventory   int         `orm:"inventory" json:"inventory"`     // 库存
	CrmGameId   int         `orm:"crmGameId" json:"crmGameId"`     // 游戏ID,礼品所属的游戏
}

var (
	// Table is the table name of crmGiftGoods.
	Table = "crm_gift_goods"
	M     = g.DB("default").Model(Table).Safe()
)

/**
{
    "keyWord": "商品标题", // 模糊搜索，搜索的字段对应keyWordLikeFields
    "types": 1, // 全等于筛选，对应fieldEq
    "page": 2, // 第几页
    "size": 1, // 每页返回个数
    "sort": "desc", // 排序方向
    "order": "id" // 排序字段
	"startTime": "2021-08-02 00:00:00",//用创建时间判断
    "endTime": "2021-09-30 23:59:59",//用创建时间判断
	"isExport": true,//是否是都出excel
}
*/
//分页请求参数
type PageReqParams struct {
	KeyWord   string `p:"keyWord"`
	Page      int    `p:"page" default:"1"`
	Size      int    `p:"size" default:"20"`
	Order     string `p:"order"`
	Sort      string `p:"sort"`
	IsExport  bool   `p:"isExport"`
	StartTime string `p:"startTime"`
	EndTime   string `p:"endTime"`
}
type AddReqParams struct {
	Title       string  `p:"title" v:"required#商品标题不能为空"`
	Description string  `p:"description" `
	Pic         string  `p:"pic" `
	OriginPrice float64 `p:"originPrice" v:"required#原价格不能为空"`
	Price       float64 `p:"price" v:"required#当前价格不能为空"`
	Discount    float64 `p:"discount" v:"required#优惠的价格不能为空"`
	Inventory   int     `p:"inventory" v:"required#库存不能为空"`
	CrmGameId   int     `p:"crmGameId" `
}
type UpdateReqParams struct {
	Id          uint    `p:"id" v:"required#ID不能为空"`
	Title       string  `p:"title" `
	Description string  `p:"description" `
	Pic         string  `p:"pic" `
	OriginPrice float64 `p:"originPrice" `
	Price       float64 `p:"price" `
	Discount    float64 `p:"discount" `
	Inventory   int     `p:"inventory" `
	CrmGameId   int     `p:"crmGameId" `
}
type InfoReqParams struct {
	Id int `p:"id" v:"required#id不能为空"`
}
type ListReqParams struct {
	Title string `p:"title" `
}
type DeleteReqParams struct {
	Ids []int `p:"ids" v:"required#ids不能为空"`
}
